package edu.chl.jadetalk.admin.view;

import com.ocpsoft.pretty.time.PrettyTime;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import edu.chl.jadetalk.admin.util.ServerInfoUtilityBean;
import java.text.SimpleDateFormat;
import javax.faces.bean.ManagedProperty;

/**
 *
 * @author jesper
 */
@ManagedBean
@RequestScoped
public class ServerInfoSupportBean {

    @ManagedProperty(value="#{serverInfoUtilityBean}")      
    ServerInfoUtilityBean utilBean;

    public ServerInfoUtilityBean getUtilBean() {
        return utilBean;
    }

    public void setUtilBean(ServerInfoUtilityBean utilBean) {
        this.utilBean = utilBean;
    }
    
    /** Creates a new instance of ServerInfoSupportBean */
    public ServerInfoSupportBean() {
    }
    
    public String getServerStartTime(){
        PrettyTime ptime = new PrettyTime();
        return ptime.format(utilBean.getServerStartTime());
        
    }
    
    public String getServerLocalTime(){
        return new SimpleDateFormat("hh:mm:ss").format(utilBean.getServerTime());
    }
    
}
